package com.eascs.p2p.common.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.eascs.p2p.common.wallet.utils.BigDecimalUtils;

import java.math.BigDecimal;
import java.util.Date;


/**
 * The persistent class for the p2p_investor_record database table.
 * 
 */
@Entity
@Table(name="p2p_investor_record")
@NamedQuery(name="P2pInvestorRecord.findAll", query="SELECT p FROM P2pInvestorRecord p")
public class InvestorRecordEntity implements Serializable {
	private static final long serialVersionUID = 1L;
	
	/**投资状态(1:成功,0无效)*/
	public static final byte STATUS_YES=1;
	public static final byte STATUS_NO=0;

	@Id
	private String id;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="create_time")
	private Date createTime;

	@Column(name="invest_amount")
	private BigDecimal investAmount;
	
	@Column(name="expect_amount")
	private BigDecimal expectAmount;

	@Column(name="investor_id")
	private String investorId;

	@Column(name="loanee_id")
	private String loaneeId;

	@Column(name="object_id")
	private String objectId;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="update_time")
	private Date updateTime;
	
	@Column(name="investor_account")
	private String investorAccount;
	
	@Column(name="investor_nickname")
	private String investorNickName;
	
	private int status = -1;
	
	public InvestorRecordEntity() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public BigDecimal getInvestAmount() {
		return BigDecimalUtils.convertNull(this.investAmount);
	}

	public void setInvestAmount(BigDecimal investAmount) {
		this.investAmount = investAmount;
	}

	public String getInvestorId() {
		return this.investorId;
	}

	public void setInvestorId(String investorId) {
		this.investorId = investorId;
	}

	public String getLoaneeId() {
		return this.loaneeId;
	}

	public void setLoaneeId(String loaneeId) {
		this.loaneeId = loaneeId;
	}

	public String getObjectId() {
		return this.objectId;
	}

	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public BigDecimal getExpectAmount() {
		return expectAmount;
	}

	public void setExpectAmount(BigDecimal expectAmount) {
		this.expectAmount = expectAmount;
	}

	public String getInvestorAccount() {
		return investorAccount;
	}

	public void setInvestorAccount(String investorAccount) {
		this.investorAccount = investorAccount;
	}

	public String getInvestorNickName() {
		return investorNickName;
	}

	public void setInvestorNickName(String investorNickName) {
		this.investorNickName = investorNickName;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "InvestorRecordEntity [id=" + id + ", createTime=" + createTime + ", investAmount=" + investAmount
				+ ", expectAmount=" + expectAmount + ", investorId=" + investorId + ", loaneeId=" + loaneeId
				+ ", objectId=" + objectId + ", updateTime=" + updateTime + ", investorAccount=" + investorAccount
				+ ", investorNickName=" + investorNickName + ", status=" + status + "]";
	}

	
	
}